home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1996 April / Software of the Month Club 1996 April.iso / pc / os2 / psutils / src / fixwpps.pl < prev    next >
Text File  |  1996-02-21  |  668b  |  32 lines

  1. @PERL@
  2. # fixwpps: get semi-conforming PostScript out of WordPerfect 5.0 file
  3. #
  4. # Copyright (C) Angus J. C. Duggan 1991-1995
  5. # See file LICENSE for details.
  6.  
  7. $page = 1;
  8. $nesting = 0;
  9.  
  10. while (<>) {
  11.    s/([^\/]_t)([0-9]+)/\1 \2/g;    # fix wp 5.0 bug
  12.    if (m!/_[be][dp]! || m!_bp \d+ \d+ roll!) {
  13.       print $_;
  14.    } elsif (/^(.*)(_bp.*)$/) {
  15.       print "$1\n" if $1 ne "";
  16.       print "%%Page: $page $page\n";
  17.       print "$2\n";
  18.       $page++;
  19.       $nesting++;
  20.    } elsif (/_ep$/) {
  21.       print $_;
  22.       $nesting--;
  23.    } elsif (/^(.*)(_ed.*)/) {
  24.       print "$1\n" if $1 ne "";
  25.       print "%%Trailer:\n";
  26.       print "$2\n";
  27.    } else {
  28.       print $_;
  29.    }
  30. }
  31. @END@
  32.